package com.biboheart.breport.support.definition;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum FieldTypeEnum {
    FIELD_TYPE_00(0, "普通文本"),
    FIELD_TYPE_01(1, "可索引"),
    FIELD_TYPE_02(2, "日期时间"),
    FIELD_TYPE_03(3, "可度量"),
    FIELD_TYPE_04(4, "可分组"),
    ;
    private final Integer type;
    private final String desc;

    public static FieldTypeEnum getInstance(Integer type) {
        for (FieldTypeEnum fieldTypeEnum : FieldTypeEnum.values()) {
            if (fieldTypeEnum.getType().equals(type)) {
                return fieldTypeEnum;
            }
        }
        return null;
    }
}
